import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/index"
  },
  {
    path: "/index",
    name: "index",
    component: () => import("../views/index.vue"),
    children: [
      // 首页
      {
        path: "home",
        redirect: "/index"
      },
      {
        path: "/index",
        component: () => import("../views/home/home.vue")
      },
      // 设备中心
      {
        path: "/EquipmentCenter",
        redirect: "/EquipmentCenter/equipment-distribution"
      },
      {
        path: "/EquipmentCenter/equipment-distribution",
        name: "equipment-distribution",
        component: () =>
          import("../views/EquipmentCenter/equipment-distribution.vue")
      },
      {
        path: "/EquipmentCenter/equipment-statistics",
        name: "equipment-statistics",
        component: () =>
          import("../views/EquipmentCenter/equipment-statistics.vue")
      },
      {
        path: "/EquipmentCenter/all-equipment",
        name: "all-equipment",
        component: () =>
          import("../views/EquipmentCenter/EquipmentList/equipments.vue")
      },
      {
        path: "/EquipmentCenter/running-equipment",
        name: "running-equipment",
        component: () =>
          import("../views/EquipmentCenter/EquipmentList/equipments.vue")
      },
      {
        path: "/EquipmentCenter/disable-equipment",
        name: "disable-equipment",
        component: () =>
          import("../views/EquipmentCenter/EquipmentList/equipments.vue")
      },
      // 监控中心
      {
        path: "/MonitoringCenter",
        redirect: "/MonitoringCenter/distribution"
      },
      {
        path: "/MonitoringCenter/distribution",
        name: "distribution",
        component: () => import("../views/MonitoringCenter/distribution.vue")
      },
      {
        path: "/MonitoringCenter/video",
        name: "video-monitor",
        component: () => import("../views/MonitoringCenter/video.vue")
      },
      // 事件中心
      {
        path: "/EventCenter",
        redirect: "/EventCenter/event-report"
      },
      {
        path: "/EventCenter/event-report",
        name: "event-report",
        component: () => import("../views/EventCenter/event-report.vue")
      },
      {
        path: "/EventCenter/pending-event",
        name: "pending-event",
        component: () => import("../views/EventCenter/events.vue")
      },
      {
        path: "/EventCenter/established-event",
        name: "established-event",
        component: () => import("../views/EventCenter/events.vue")
      },
      {
        path: "/EventCenter/event-statistics",
        name: "event-statistics",
        component: () => import("../views/EventCenter/event-statistics.vue")
      },
      {
        path: "/EventCenter/pedlar-event",
        name: "pedlar-event",
        component: () => import("../views/EventCenter/event-distribution.vue")
      },
      {
        path: "/EventCenter/restaurant-event",
        name: "restaurant-event",
        component: () => import("../views/EventCenter/event-distribution.vue")
      },
      {
        path: "/EventCenter/bad-event",
        name: "bad-event",
        component: () => import("../views/EventCenter/event-distribution.vue")
      },
      {
        path: "/EventCenter/pm2.5-event",
        name: "pm2.5-event",
        component: () => import("../views/EventCenter/event-distribution.vue")
      }
    ]
  }
];

const router = new VueRouter({
  routes
});

export default router;
